#include "stdafx.h"
#include "v2base.h"
#include <stdio.h>
#include <sys/stat.h>
#include <time.h>


// ============================================================================
// function timestamp(format)
// get current date time string by specified format, e.g: "%Y-%m-%d %H:%M:%S"
// ============================================================================
char __timestampStr[64] = "";
const char* timestamp(const char* format)
{
    time_t t_now = time( 0 ); 
    tm tm_out;
    localtime_s(&tm_out, &t_now);
    strftime(__timestampStr, sizeof(__timestampStr), format, &tm_out); 
    return __timestampStr; 
}